﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SeoWebSite.DBUtility;
using SeoWebSite.BLL;

public partial class service : System.Web.UI.Page
{
    protected string responseText = "";
    OS os = new OS();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.ProccessService();
        }
    }

    private void ProccessService()
    {
        string service = Request.Form["service"];

        if (!string.IsNullOrEmpty(service))
        {
            if (service == "load")
            {
                string module_id = Request.Form["moduleId"];
                if (!string.IsNullOrEmpty(module_id))
                {
                    responseText = os.load_module(module_id);
                }
            }
            else if (service == "login")
            {
                //登录方法
                responseText = os.Login(Request.Form["user"], Request.Form["pass"], Request.Form["group"]);
            }
            else if (service == "forgotPassword")
            {
                //忘记密码
            }
            else if (service == "signup")
            {
                //注册
            }
        }
        else
        {
            string method_name = Request.Form["method"];
            string module_id = Request.Form["moduleId"];
            //make_request
            if (!string.IsNullOrEmpty(method_name) && !string.IsNullOrEmpty(module_id))
            {
                responseText = os.make_request(module_id, method_name);
            }
        }
    }
}